package com.tongji.diy.controller
{
	import com.tongji.diy.event.RoomRotationEvent;
	import com.tongji.diy.model.RoomDataModel;
	
	import org.robotlegs.mvcs.Command;
	
	public class RoomRotationCommand extends Command
	{
		[Inject]
		public var event:RoomRotationEvent;
		
		[Inject]
		public var model:RoomDataModel;
		
		public function RoomRotationCommand()
		{
			super();
		}
		
		override public function execute():void
		{
			switch(event.type)
			{
				case RoomRotationEvent.ROOM_ROTATION_CLOCKWISE:
					model.roomRotate(event.roomIndex, true);
					break;
				case RoomRotationEvent.ROOM_ROTATION_COUNTERCLOCKWISE:
					model.roomRotate(event.roomIndex, false);
					break;
			}
		}
	}
}